ScanDeviceManager SendConfigData
Sends device configuration data to a specified file on the specified device. The modified configuration data sent back to the card will be used immediately and saved to the specified file in the device storage. The API will detect the data type and update the master configuration file to load the file again during the next boot up as well.
Overloads
public void SendConfigData(string deviceName, string strData, string strStorageName, uint uiTimeout) |
Return value
void |
Parameters
string | deviceName | The unique name of the device. |
string | strData | Formatted data to be sent in XML format |
string | strStorageName | File name of the configuration data to be stored. |
uint | uiTimeout | Timeout waiting for the operation to complete |
The iDataType is defined in the SMC software reference manual and categorize the type of data to be fetched.
Fixed Data type | Data ID |
Controller Configuration | 0x05 |
Laser Configuration | 0x06 |
Lens Configuration | 0x02 |
Correction Table | 0x0D |
User Configuration | 0x0F |
Performance Adjustments | 0x10 |
Admin Configuration | 0x0A |
Servo Parameters | 0x20 |
ScanPack Configuration | 0x21 |
Please refer SMC Software Reference Manual (6.3.1 ADMINISTRATION CONFIGURATION) for further information.
Exceptions
DeviceNotFoundException | Throws when the device with the given name is not found |
CorrectionFileUploadFailedException | Throws if failed to send configuration data or timeout. |
Example
Copy
bool loadStatus = scanDeviceManager.CanLoadConfigurationDataFromScanDevice(GetselectedDeviceUniqueName());
if (loadStatus)
{
string ControllerConfiguration = "";
string LaserConfiguration = "";
string LensConfiguration = "";
string CorrectionTable = "";
try
{
scanDeviceManager.GetConfigData(GetselectedDeviceUniqueName(), 0x05, out ControllerConfiguration, 500);
//scanDeviceManager.GetConfigData(GetselectedDeviceUniqueName(), 0x0D, out CorrectionTable, 500);
//scanDeviceManager.GetConfigData(GetselectedDeviceUniqueName(), 0x06, out LaserConfiguration, 500);
//scanDeviceManager.GetConfigData(GetselectedDeviceUniqueName(), 0x02, out LensConfiguration, 500);
}
catch (Exception exp)
{
MessageBox.Show("Exception >> " + exp.Message);
}
if (!string.IsNullOrEmpty(ControllerConfiguration))
{
string newControlConfiguration = ControllerConfiguration;
// prepare new control configuration and send back
scanDeviceManager.SendConfigData(GetselectedDeviceUniqueName(), ControllerConfiguration, "newStorage", 500);
}
}